import 'package:flutter_test/flutter_test.dart';
import 'package:log_console/log_console.dart';
import 'package:log_console/log_console_platform_interface.dart';
import 'package:log_console/log_console_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockLogConsolePlatform
    with MockPlatformInterfaceMixin
    implements LogConsolePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final LogConsolePlatform initialPlatform = LogConsolePlatform.instance;

  test('$MethodChannelLogConsole is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelLogConsole>());
  });

  test('getPlatformVersion', () async {
    LogConsole logConsolePlugin = LogConsole();
    MockLogConsolePlatform fakePlatform = MockLogConsolePlatform();
    LogConsolePlatform.instance = fakePlatform;

    expect(await logConsolePlugin.getPlatformVersion(), '42');
  });
}
